package com.karst.essentials.chapter06
{
	import flash.events.Event;
	
	import org.papervision3d.materials.ColorMaterial;
	import org.papervision3d.objects.DisplayObject3D;
	import org.papervision3d.objects.primitives.Plane;
	import org.papervision3d.view.BasicView;

	internal class MouseInteractionExample1 extends InteractionTemplate
	{
		private var easeOut : Number = .3 ;
		private var reachX : Number = .5 ;
		private var reachY : Number = .5 ;
		private var reachZ : Number = .5 ;
		
		public function MouseInteractionExample1()
		{
			super() ;
		}

		override protected function onRenderTick(event:Event=null):void
		{
			super.onRenderTick( event ) ;
			camera.x += ( mouseX - width * .5 - camera.x * reachX ) * easeOut ;
			camera.y += ( -(mouseY - height * .5) - camera.y * reachY ) * easeOut ;
			camera.z += ( -mouseY * 2 - camera.z ) * reachZ ;
		}
	}
	
}